#ifndef NEWWHITEBOARD_H
#define NEWWHITEBOARD_H

#include <QWidget>
#include <QPixmap>

#include "PloygonWidget.h"
#include "SizePropertyWidget.h"
#include "ColorWidget.h"
#include "PaintListWidget.h"

namespace Ui {
class NewWhiteBoard;
}

class NewWhiteBoard : public QWidget
{
    Q_OBJECT

public:
    explicit NewWhiteBoard(QWidget *parent = nullptr);
    ~NewWhiteBoard();

protected:
    void init();

    // 隐藏所有子属性窗口
    void AllPropertyWidgetHide();
    void setNormalEraser();

    // 修改按钮样式
    void ChangeButtonFace(const PW::BUTTONFACE &);

protected slots:
    void paintEvent(QPaintEvent *);

//    void changeBackgroundColor(const QColor &);
    void on_Button_Pen_clicked();
    void on_Button_Ploygon_clicked();
    void on_Button_Eraser_clicked();
    void on_Button_PenSIze_clicked();
    void on_Button_PenColor_clicked();
    void on_Button_PaintWidgetBackground_clicked();
    void on_Button_Revocation_clicked();
    void on_Button_PaintWidgetClear_clicked();
    void on_Button_PaintWidgetList_clicked();
    void on_Button_PaintWidgetSave_clicked();
    void on_Button_Exit_clicked();

    void OpenShowPaint(const QString &);
    void ListDeleteDown(const QString &);

    void ChangeBackground();
    void setPen();
    void setPloygonType();

private:
    Ui::NewWhiteBoard *ui;
//    QPixmap *cacheMap;
    // 子窗口
    PloygonWidget *ploygonWidget;
    SizePropertyWidget *sizePropertyWidget;
    ColorWidget *fontColorWidget;
    ColorWidget *backgroundColorWidget;
    PaintListWidget *paintListWidget;

    bool isLucency;
};

#endif // NEWWHITEBOARD_H
